package com.etc.dao;

import com.etc.entity.SysLog;
import com.etc.entity.SysLogExample;
import com.etc.entity.SysLogKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface SysLogMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    int countByExample(SysLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    int deleteByExample(SysLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    @Delete({
        "delete from sys_log",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(SysLogKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    @Insert({
        "insert into sys_log (id, handle_number, ",
        "turnover, receive_number, ",
        "overdue_number, save_date, ",
        "update_date)",
        "values (#{id,jdbcType=INTEGER}, #{handleNumber,jdbcType=INTEGER}, ",
        "#{turnover,jdbcType=VARCHAR}, #{receiveNumber,jdbcType=INTEGER}, ",
        "#{overdueNumber,jdbcType=INTEGER}, #{saveDate,jdbcType=TIMESTAMP}, ",
        "#{updateDate,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=true, resultType=Integer.class)
    int insert(SysLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    int insertSelective(SysLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    List<SysLog> selectByExample(SysLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "id, handle_number, turnover, receive_number, overdue_number, save_date, update_date",
        "from sys_log",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    SysLog selectByPrimaryKey(SysLogKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") SysLog record, @Param("example") SysLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") SysLog record, @Param("example") SysLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(SysLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_log
     *
     * @mbggenerated
     */
    @Update({
        "update sys_log",
        "set handle_number = #{handleNumber,jdbcType=INTEGER},",
          "turnover = #{turnover,jdbcType=VARCHAR},",
          "receive_number = #{receiveNumber,jdbcType=INTEGER},",
          "overdue_number = #{overdueNumber,jdbcType=INTEGER},",
          "save_date = #{saveDate,jdbcType=TIMESTAMP},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(SysLog record);
    List<SysLog> findByAll();
}